<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head id="MyHead">
    <script src="/resources/Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="/resources/Scripts/JScriptCommon.js" type="text/javascript"></script>
    <link href="/resources/Content/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script src="/resources/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="/resources/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
    <link href="/resources/Content/IndexStyle.css" rel="stylesheet" type="text/css" />
            <script src="/resources/Res/easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="/resources/Res/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <link href="/resources/Res/easyui/themes/icon.css" rel="stylesheet"
        type="text/css" />
    <link href="/resources/Res/easyui/themes/default/easyui.css" rel="stylesheet"
        type="text/css" />

    <title>

</title>
    
    <script type="text/javascript">
  
   		
        $(function () {
      	$.ajax({
        		type:"GET",//请求类型
        		url:"getJson",//请求的url
        		dataType:"json",//ajax接口（请求url）返回的数据类型
        		success:function(returnValue){//data：返回数据（json对象）
        			if(returnValue != null){
        				/* $("productId").html("");//通过标签选择器，得到select标签，适用于页面里只有一个select
        				var options = "<option value=\"0\">请选择</option>";
        				for(var i = 0; i < data.length; i++){
        					//alert(data[i].id);
        					//alert(data[i].proName);
        					options += "<option value=\""+data[i].productId+"\">"+data[i].productName+"</option>";
        				}
        				$("productId").html(options); */
        				 var data = [];
        				    $.each(returnValue, function(i,val){
        				        //这里的"text","id"和html中对应
        				        data.push({ "text": val.productName, "id": val.productId });
        				    })
        				    $("#productId").combobox("loadData", data);
        				
        			}
        		}
        	}); 
        $("productId").combobox({
        	url:'getJson',
        	valueField:'productId',
        	textField:'productName'
        });

        	 $("#submit").click(function () {
                 if ($("branchSchool").combobox("getValue") == "") {
                     $.messager.alert('系统提示：', '请选择所属分校！', 'warning');
                     return false;
                 }
             });

        	 $("#submit").click(function () {
                 if ($("licenseType").combobox("getValue") == "") {
                     $.messager.alert('系统提示：', '请选择准驾车型！', 'warning');
                     return false;
                 }
             });
	         $("#submit").click(function () {
	                if ($("clazzState").combobox("getValue") == "") {
	                    $.messager.alert('系统提示：', '请选择班别状态！', 'warning');
	                    return false;
	                }
	            });
        });
              

    </script>

    <script type='text/javascript'>
        function ajaxFrom(form, url) {
            progressComm();
            $.ajax({
                url: url,
                type: "Post",
                data: $(form).serialize(),
                dataType: "json",
                success: function (data) {
                    $.messager.progress('close');
                    if ($.messager) {
                        $.messager.defaults.cancel = '返回';
                        $.messager.defaults.ok = '继续';

                        $.messager.confirm('操作提示', data.msg, function (r) {
                            if (!r) {
                                window.location.href = 'javascript:history.go(-1)';
                                //alert("aaaaaaaa");
                            }
                        });
                    }

                }
            });

        }

        $(function () {
            
            $("form").submit(function (form) {
                if (form.result) {
                    ajaxFrom(this, this.action);
                }
                return false;
            });
        });
    </script>
<body>
<div class="mbx">
        
      创建 班别

    </div>
    <form action="create" method="post">
    

    <fieldset>
        <legend>
            <input class="submitcss" type="submit" id="submit" value="创建" />
            <input class="submitcss" type="button" onclick="BackList('clazz.html')" value="返回" />
        </legend>
        <div class="bigdiv">
                            
             
		<div class="editor-label">
                	班别名称
        </div>
        <div class="editor-field">
            <input class="text-box single-line" data-val="true" data-val-length="长度不可超过36" data-val-length-max="36" id="clazzName" name="clazzName" type="text" value="" />
        </div>
               
        
       <div class="editor-label">           	
                     	准驾车型
            </div>
            <div class="editor-field">
            <select class="easyui-combobox" data-val="true" data-val-length="长度不可超过50" data-val-length-max="50" id="licenseType" name="licenseType" style="width:210px;">
            <option value="">请选择</option>
            <option value="c1">c1</option>
            <option value="c1">c2</option>
			</select>
            </div>
            <div class="editor-label">           	
                     	所属分校
            </div>
            <div class="editor-field">
            <select class="easyui-combobox" data-val="true" data-val-length="长度不可超过50" data-val-length-max="50" id="branchSchool" name="branchSchool" style="width:210px;">
            <option value="">请选择</option>
            <option value="总校">总校</option>
            <option value="挂靠">挂靠</option>
			</select>
            </div>
              <div class="editor-label">
                <label for="productId">所属产品</label>
            </div>
            <div class="editor-field">
          <select class="easyui-combobox" name="productId" style="width:210px;" id="productId"   data-options="valueField:'id', textField:'text', panelHeight:'auto'" >
         </select>
            </div>  
             <div class="editor-label">
                     	班别状态
            </div> 
             <div class="editor-field">
            <select class="easyui-combobox" data-val="true" data-val-length="长度不可超过50" data-val-length-max="50" id="clazzStatus" name="clazzStatus" style="width:210px;">
            <option value="">请选择</option>
            <option value="启动">启动</option>
            <option value="关闭">关闭</option>
			</select>
            </div>
            <br style="clear: both;" />
           
			
        </div>
    </fieldset>

    </form>
</body>
</html>